package com.k2data.etl.datasender;


import vcommon.utils.TimeUtils;

public class TcsDataBuilder {

    private static String TCSDataTempJson = "{\"tenant\":\"default_tenant\",\"user\":\"tadmin_default_tenant\",\"tstable\":\"{tableName}\",\"timestamp\":{timestamp},\"tags\":{\"factory_id\":\"1\",\"equipment_id\":\"10000\",\"machine_id\":\"1\",\"datatype\":\"1\",\"channel_type\":\"10\",\"channel_id\":\"1\"},\"fields\":{\"TI010702_2\":14.077,\"TI010703_3\":33.139,\"TI010704_4\":40.973,\"TI010705_5\":15.606,\"TI010706_6\":8.24,\"PI014117_7\":0.526,\"PI010702A_8\":0.521,\"PI010702B_9\":0.521,\"PI010702C_10\":0.519,\"LI010701B_11\":1509.506,\"LIC010702B_12\":1367.097,\"LI010701C_13\":1445.954,\"FIC010703_14\":506.309,\"FIC010704_15\":101.506,\"II010711B_16\":211.95,\"II010712B_17\":-0.358,\"II010713B_18\":140.237,\"II010714B_19\":-0.267,\"FIC010703_20\":53,\"FIC010704_21\":54.074,\"HC010706_22\":0,\"LIC010701_23\":1509.506,\"LIC010701_24\":56.462,\"LIC010702B_25\":79.566,\"PDI010702_26\":0.005}}";

    private static int index = 0;

    public static String build() {
        index ++;

        if(index > 10){
            index = 0;
        }

        index = 100;

        return TCSDataTempJson.replace("{tableName}", "sg_tcs_" + index).replace("{timestamp}", TimeUtils.now() + "");
    }

}
